/*
 *   Copyright (c) 2010-2022, SIUFUNG
 */
package net.siufung.market.base.user.controller.model.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;
import net.siufung.core.utils.CopyUtil;
import net.siufung.market.base.user.mapper.entity.User;

import java.io.Serializable;

/**
 * <p>
 * 系统用户表 默认数据传参对象
 * </p>
 * @author 陈建峰
 * @since 2022-07-05 16:14:50
 */
@Slf4j
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="UserDto", description="系统用户表默认数据传输对象")
public class UserDto implements Serializable {

    private static final long serialVersionUID = -7290058519520646244L;
    /**
     * 主键ID
     */
    @ApiModelProperty(value = "主键ID")
    private Integer id;

    /**
     * 登录名
     */
    @ApiModelProperty(value = "登录名")
    private String loginName;

    /**
     * 登录密码
     */
    @ApiModelProperty(value = "登录密码")
    private String loginPwd;

    /**
     * 用户全称
     */
    @ApiModelProperty(value = "用户全称")
    private String userName;

    /**
     * 初始化标识
     */
    @ApiModelProperty(value = "初始化标识")
    private Boolean initFlag;

    /**
     * 管理员级别
     */
    @ApiModelProperty(value = "管理员级别")
    private Boolean adminState;

    /**
     * 部门Id
     */
    @ApiModelProperty(value = "部门Id")
    private String deptId;

    /**
     * 岗位Id
     */
    @ApiModelProperty(value = "岗位Id")
    private String postId;

    /**
     * 用户电话
     */
    @ApiModelProperty(value = "用户电话")
    private String mobile;

    /**
     * 最后登录IP
     */
    @ApiModelProperty(value = "最后登录IP")
    private String loginLastIp;

    /**
     * 最后登录时间
     */
    @ApiModelProperty(value = "最后登录时间")
    private String loginLastDate;

    /**
     * 租户ID
     */
    @ApiModelProperty(value = "租户ID")
    private String tenantId;

    /**
     * 转化成数据库实体
     * @return User
     */
    public User to(){
        User user = new User();
        CopyUtil.copyProperties(this, user);
        return user;
    }
}